package com.example.xyxwebbackend001.model.enums;

public enum TagEnum {
    TECH(1, "传统建筑"),
    PROGRAMMING(2, "特色美食"),
    TRAVEL(3, "地方习俗"),
    FOOD(4, "手工艺"),
    SPORTS(5, "传统服饰");

    private final int code;
    private final String name;

    TagEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    // 添加根据code获取枚举的方法
    public static TagEnum getByCode(int code) {
        for (TagEnum value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }
    public int getCode() {
        return code;
    }
    public String getName() {
        return name;
    }

}
